// module.exports = {
//     entry: './main.js',
//     output: {
//         filename: './bundle.js'
//     }
// };

var path = require( 'path' );
var webpack = require( 'webpack' );
// var url = require( 'url-loader' );
// var HtmlwebpackPlugin = require( 'html-webpack-plugin' );
// var uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
//定义了一些文件夹的路径
var ROOT_PATH = path.resolve( __dirname );
var APP_PATH = path.resolve( ROOT_PATH, 'src' );
var BUILD_PATH = path.resolve( ROOT_PATH, 'build' );
module.exports = {
    //项目的文件夹 可以直接用文件夹名称 默认会找index.js 也可以确定是哪个文件名字
    entry:     {
        app:     path.resolve( APP_PATH, 'main.js' )
    },
    //输出的文件名 合并以后的js会命名为bundle.js
    output:    {
        path:     BUILD_PATH,
        filename: 'bundle.js'
    },
    resolve:   {
        root: [
            path.resolve( 'src/' )
        ]
    },
    devServer: {
        historyApiFallback: true,
        hot:                true,
        inline:             true,
        progress:           true
    },
    // devtool: 'eval-source-map', //启用source-map
    module:    {
        // loaders: [
        //     {test: /\.css$/, loader: "style-loader!css-loader"},
        //     {test: /.(png|jpg)$/, loader: 'url?limit=8192'},
        //     {test: /\.html$/, loader: 'raw'},
        // ]
    }
};
